<?php

namespace app\api\model;

use think\Model;
use think\Db;

class Tenant extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'ty_tenant';
    /**
     * 获取
     */
    public static function getList($field)
    {
        $list = self::alias('tt')
            ->where(['tt.tenant_status' => 1])
            ->join('ty_room tr','tt.room_id = tr.r_id')
            ->field($field)
            ->select();
        return $list;
    }
    public static function getHouseId(){
        $list = self::group('house_id')
            ->field('house_id')
            ->select();
        return $list;
    }
    public static function getNum($where){
        $count = self::where($where)
            ->count();
        return $count;
    }
}
